/* 主题变量 */
:root {
    --primary-color: #2a7fff;       /* 主蓝色 */
    --primary-hover: #1a5fcf;
    --background: #f0f8ff;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --border-color: #e0e6ed;
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: '微软雅黑', sans-serif;
}

body {
    background: var(--background);
    color: var(--text-dark);
}

/* 顶部导航 */
.user-header {
    background: var(--primary-color);
    padding: 1rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(42, 127, 255, 0.2);
}

.nav-container {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    color: var(--text-light);
    font-size: 1.8rem;
    font-weight: 600;
    margin-right: 3rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.nav-links a:hover,
.nav-active {
    background: rgba(255, 255, 255, 0.15);
}

/* 搜索栏 */
.search-bar {
    margin-left: auto;
    display: flex;
    gap: 0.8rem;
}

.search-input {
    padding: 0.8rem 1.2rem;
    border: none;
    border-radius: 25px;
    width: 300px;
    background: rgba(255, 255, 255, 0.9);
}

.search-btn {
    background: var(--text-light);
    color: var(--primary-color);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
}

.search-btn:hover {
    background: var(--primary-hover);
    color: white;
}

/* 轮播图 */
.carousel {
    margin-top: 80px;
    height: 450px;
    overflow: hidden;
    position: relative;
    border-radius: 8px;
    margin: 80px 20px 0;
}

.slide {
    width: 100%;
    height: 100%;
    position: absolute;
    opacity: 0;
    transition: opacity 0.5s;
}

.slide.active {
    opacity: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 分类 */
.categories {
    padding: 3rem 20px;
}

.section-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.category-card {
    background: white;
    padding: 1.5rem;
    text-align: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(42, 127, 255, 0.1);
}

/* 商品 */
.products {
    padding: 2rem 20px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    height: 250px;
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.product-price {
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 700;
}

.add-to-cart {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.3s;
}

.add-to-cart:hover {
    background: var(--primary-hover);
}

/* ================= 套餐专区 ================= */
.setMeals {
    padding: 2rem 20px;
    background: #fff;
    margin-top: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.setmeal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.setmeal-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s;
    position: relative;
}

.setmeal-card:hover {
    transform: translateY(-5px);
}

.setmeal-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.setmeal-image {
    height: 200px;
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
}

.setmeal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.setmeal-image:hover img {
    transform: scale(1.05);
}

.setmeal-info {
    padding: 1.5rem;
}

.setmeal-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.setmeal-price {
    color: #ff6b6b;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.setmeal-score {
    color: #666;
    font-size: 0.95rem;
}




/* 页脚 */
.footer {
    background: var(--text-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: 3rem 20px;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.copyright {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 2000px) {
    .nav-container {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.5rem; /* 减少间距 */
        padding: 0 10px; /* 减少内边距 */
    }

    .nav-right {
        display: flex;
        align-items: center;
        gap: 0.5rem; /* 减少元素间距 */
        flex: 1; /* 关键：占据剩余空间 */
        min-width: max-content; /* 允许内容撑开 */
    }

    .nav-left {
        display: flex;
        align-items: center;
        gap: 0.5rem; /* 减少元素间距 */
        flex: 1; /* 关键：占据剩余空间 */
        min-width: max-content; /* 允许内容撑开 */
    }

    .search-bar {
        flex: 1; /* 关键：允许搜索栏伸缩 */
        min-width: 150px; /* 设置最小宽度 */
    }

    .search-input {
        width: 100%; /* 输入框填满容器 */
        min-width: 120px; /* 输入框最小宽度 */
    }

    .user-info {
        white-space: nowrap; /* 禁止用户信息换行 */
        flex-shrink: 0; /* 禁止收缩 */
    }
}